using SmartLink.Domain.ExpandEntity.Base;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

namespace SmartLink.DTOS
{
    public class Results
    {
        /// <summary>
        /// 是否成功：1=成功，0=未成功
        /// </summary>
        public int State { get; set; }

        /// <summary>
        /// 返回的消息
        /// </summary>
        public string Message { get; set; }
    }

    public class Results<T> : Results
    {
        /// <summary>
        /// 返回的数据
        /// </summary>
        public T Data { get; set; }
    }
    /// <summary>
    /// 返回的list数据
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class PageData<T>
    {
        /// <summary>
        /// 总页数
        /// </summary>
        public int TotalCount { get; set; }

        /// <summary>
        /// 当前数据
        /// </summary>
        public IEnumerable<T> CurrentData { get; set; }
    }
    /// <summary>
    /// 分页属性
    /// </summary>
    public class PageBase
    {
        /// <summary>
        /// 页码
        /// </summary>
        public int PageIndex { get; set; } = 1;

        /// <summary>
        /// 页数
        /// </summary>
        public int PageSize { get; set; } = 15;

        /// <summary>
        /// 是否查询总条数
        /// </summary>
        public bool IsSearchTotal { get; set; } = false;

        /// <summary>
        /// 是否进行分页
        /// </summary>
        public bool IsPagination { get; set; } = true;

        /// <summary>
        /// 转换成Domain层分页对象
        /// </summary>
        /// <returns></returns>
        public Pagination ToPagination()
        {
            return new Pagination(PageIndex, PageSize, IsSearchTotal);
        }

    }
    /// <summary>
    /// 通用数据分页查询
    /// </summary>
    public class ListPagePara : PageBase
    {
        /// <summary>
        /// 关键字
        /// </summary>
        public string KeyValue { get; set; }
    }

    /// <summary>
    /// 通用时间分页查询
    /// </summary>
    public class TimePagePara : PageBase
    {
        /// <summary>
        /// 开始时间
        /// </summary>
        public string StartTime { get; set; }

        /// <summary>
        /// 结束时间
        /// </summary>
        public string EndTime { get; set; }
    }

    public class TimeDTO
    {
        /// <summary>
        /// 开始时间
        /// </summary>
        public string StartTime { get; set; }

        /// <summary>
        /// 结束时间
        /// </summary>
        public string EndTime { get; set; }
    }

    public class TimeKeyPagePara : TimePagePara
    {

        /// <summary>
        /// 公司id
        /// </summary>
        public int OID { get; set; }

        /// <summary>
        /// 部门ID
        /// </summary>
        public int ODID { get; set; }

        /// <summary>
        /// 关键字
        /// </summary>
        public string KeyValue { get; set; }
    }

    public class IDPagePara : PageBase
    {
        public int ID { get; set; }
    }

    public class TimeKey : TimeDTO
    {
        /// <summary>
        /// 关键字
        /// </summary>
        public string KeyValue { get; set; }
    }
}
